$comments_per_page=15;
if (!isset($_GET['art']) || !is_numeric($_GET['art']))
$page=1;
else $page=$_GET['art'];
?>
function get_thread($parent_id,$id_news) {
global $dbh;
$s="";
$sql="select id,admin,name,subject,txt,to_char(comment_date,'DD.MM.YYYY HH24:MI') from comments ";
$sql.="where parent_id=$parent_id and id_news=$id_news and blocked=false order by comment_date desc";
$res=pg_query($dbh,$sql);
while ($row=pg_fetch_row($res)) {
$s.="
".$row[2]." ".$row[5]."
";
$s.="
";
$s.='
'.$row[3].'
';
$s.='
'.str_replace("[quote]","
",str_replace("[/quote]","
",$row[4]))."
";
$s.="
";
}
return $s;
}
function check_txt($s,$allow_null)
{
$err="";
if ($s=="" && !$allow_null) $err.="недопустимо пустое значение!";
else if (preg_match("/(?: